<template>
    <div class="cms-menu">
        <el-menu
                :default-active="active"
                background-color="#2a3542"
                text-color="#fff"
                :router="true"
                :unique-opened="true"
                active-text-color="#1e83f0">
            <el-menu-item index="/main">
                <i class="fa fa-home"></i>
                <span slot="title">&nbsp;&nbsp;&nbsp;系统首页</span>
            </el-menu-item>
            <el-menu-item v-for="(child,i) in routers[0].children" v-if="child.meta.show" :index="child.path" :key="i+1">
                <i :class="child.meta.icon"></i>
                <span slot="title">&nbsp;&nbsp;&nbsp;{{child.meta.title}}</span>
            </el-menu-item>
        </el-menu>
    </div>

</template>

<script>
    import {mapGetters} from 'vuex';
    export default {
        computed: {
            ...mapGetters(['active','routers']),
        }
    }
</script>
